// 单例实现，无论是无论如何初始化，取到的都是同一个对象
//Manager manager = new Manager();
//Manager manager2 = Manager.instance;

class Manager {
  // 工厂模式
  factory Manager() =>_getInstance();
  static Manager get instance => _getInstance();
  static Manager _instance;
  Manager._internal() {
    // 初始化
  }
  static Manager _getInstance() {
    if (_instance == null) {
      _instance = new Manager._internal();
    }
    return _instance;
  }
}